home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / gfx / show / ViewTool.lha / ViewTool / Install / Install-Script < prev    next >
Encoding:
Text File  |  1998-03-26  |  41.3 KB  |  1,023 lines

  1. ;
  2. ;$VER: Install-Script 1.2 (12.03.98)
  3. ;               
  4. ;======================
  5. ;=== Global strings ===
  6. ;======================
  7. (set #installer_locale 0) 
  8. ;
  9. ; Determine language
  10. ;
  11. ; #installer_locale = 0: english
  12. ;                   = 1: deutsch
  13. ;                   = 2: sverige
  14. ;                           
  15. (if (= @language "deutsch") (set #installer_locale 1))
  16. (if (= @language "sverige") (set #installer_locale 2))
  17. ;
  18. ;==================== english ====================
  19. ;
  20. (if (= #installer_locale 0)
  21.     (set            
  22.         ;=== general ===
  23.         ;
  24.         #welcome_text        (cat "This script lets you install\n" @app-name "\non your system.")
  25.         #welcome_update      (cat "This script will update an existing\n" @app-name "\ninstallation.")
  26.         #welcome_remove      (cat "This script will remove an existing\n" @app-name "\ninstallation.")
  27.         #error_instvers_msg  (cat "You are using the installer version %ld.%ld.\n"
  28.                                   "This script will probably not work.\n"
  29.                                   "Try installing anyway ?")
  30.         #error_instvers_help (cat "Get the most resent version from http://www.amiga.de\nVersion 42.9+ is required.")
  31.         #action_prompt       (cat "What do you want to do ?")
  32.         #action_help         (cat "Select an action to perform.")
  33.         #action_install      (cat "Install")
  34.         #action_update       (cat "Update")
  35.         #action_remove       (cat "Remove")
  36.         #cpu_too_low         (cat "You have installed a " (database "cpu") " processor, but a 68020 processor "
  37.                                   "is minimal required in order to use " @app-name ".\nI'm quitting now...")
  38.         ;=== program files ===
  39.         ;
  40.         #askdest_prompt    (cat "Select destination for " @app-name ". A drawer will be created, if necessary.")
  41.         #askdest_help      (cat "Select the destination drawer for " @app-name ". A new drawer will be generated.")
  42.         #files2copy_prompt (cat "Select main program to install.")
  43.         #files2copy_help   (cat "Select the program file to install according to the processor your system has.")
  44.         #copycopy_prompt   (cat "The %s version of " @app-name " will be copied.")
  45.         #copycopy_help     (cat #copycopy_prompt)
  46.         ;=== catalogs ===
  47.         ;
  48.         #catalog_f2c_prompt (cat "Select language catalog to copy.")
  49.         #catalog_f2c_help   (cat "Select the language(s) to install.")
  50.         #getcat_prompt      (cat "Select target drawer for catalog(s). A drawer will be created, if necessary.")
  51.         #getcat_help        (cat "Normally, select the drawer the main program was installed to. "
  52.                                  "A new drawer will be generated, if necessary. "
  53.                                  "LOCALE: would be another option.")
  54.         #copycat_prompt     (cat "Copying %s catalog...")
  55.         #copycat_help       (cat "The %s catalog files will be copied.")
  56.         ;=== guide ===
  57.         ;
  58.         #guide_f2c_prompt (cat "Select documentation to install.")
  59.         #guide_f2c_help   (cat "Select documentation language you like to install.")
  60.         #getdoc_prompt    (cat "Select destination for documentation. A drawer will be created, if necessary.")
  61.         #getdoc_help      (cat "Normally, select the drawer the main program was installed to. "
  62.                                "A new drawer will be generated, if necessary.")
  63.         #copydoc_prompt   (cat "Copying documentation...")
  64.         #copydoc_help     (cat "The %s documentation will be copied.")
  65.         #copydoc_misc_pmt (cat "Copying miscellaneous documentation...")
  66.         #copydoc_misc_hlp (cat "Some additional texts will be copied.")
  67.         ;=== arexx ===
  68.         ;
  69.         #rexx_f2c_prompt  (cat "Install arexx examples ?")
  70.         #rexx_f2c_help    (cat "Select wether to install the example arexx files or not.")
  71.         #rexx_dest_prompt (cat "Select arexx example drawer. A new drawer will be created, if necessary.")
  72.         #rexx_dest_help   (cat "Select a drawer into which the example arexx files will be installed. "
  73.                                "A new drawer will be generated, if necessary.")
  74.         #rexx_copy_prompt (cat "Copying arexx examples...")
  75.         #rexx_copy_help   (cat "The arexx example files will be copied.") 
  76.         ;=== wbstartup ===
  77.         ;
  78.         #cpy_wbstartup_prompt (cat "Start " @app-name " automatically every time you boot ?")
  79.         #cpy_wbstartup_help   (cat "An icon will be copied to SYS:WBStartup/ drawer. Every time you boot "
  80.                                    @app-name " will be started automatically. Select the program version "
  81.                                    "to be started.")
  82.         #cpy_wbstart_none     (cat "No")       
  83.         #wbstart_prompt       (cat "The %s client will be started on boot time.")
  84.         #wbstart_help         (cat "The selected version of " @app-name " will be started during booting.")
  85.         ;=== tooltypes ===
  86.         ;
  87.         #ttype_prefs_prompt (cat "Since %s is a commodity some setup is required.\n"
  88.                                  "Type the keys which will bring up the preferences window, "
  89.                                  "for example\n'lshift lalt v' (= left shift + left alt + v):"
  90.                             )
  91.         #ttype_prefs_help   (cat "Type in a combination of keys, but without then \'.")
  92.         #ttype_load_prompt  (cat "Type the keys which will bring up a file load requester:")
  93.         #ttype_load_help    (cat "Same as previous. " #ttype_prefs_help)
  94.         #ttype_popup_prompt (cat "Should the preferences window open automatically after program start ?")
  95.         #ttype_popup_help   (cat "You can change this later via the tooltype CX_POPUP=<YES|NO>.")
  96.         #ttype_set_prompt   (cat "The requested changes to the %s program icon will be made.")
  97.         #ttype_set_help     (cat "All changes can be manually altered later.")
  98.         ;=== update drawer ===
  99.         ;
  100.         #update_dest_prompt (cat "Locate " @app-name "'s executable(s):")
  101.         #update_dest_help   (cat "Select the drawer where " @app-name "'s executable(s) resides in.")
  102.         #update_f2c_prompt  (cat "Select executables to update:")
  103.         #update_f2c_help    (cat "Select that executable(s) which should be updated.")
  104.         #update_cat_prompt  (cat "Select drawer where old catalogs were installed:")
  105.         #update_cat_help    (cat "This should be either the drawer where the executables reside in "
  106.                                  "or LOCALE:")
  107.         #update_no_exe      (cat "Couldn't find files to update. Exitting...")
  108.         ;=== remove drawer ===
  109.         ;                             
  110.         #remove_safe_prompt (cat "Do you really want to delete your\n" @app-name "\ninstallation ?")
  111.         #remove_safe_help   (cat "This is the last chance to cancel !!!")
  112.         #remove_del_prompt  (cat "Deleting old\n" @app-name "\ninstallation.")
  113.         #remove_del_help    (cat "You will get no second chance to quit !!!")
  114.         #remove_no_exe      (cat "Didn't find " @app-name " executable(s) in selected drawer. Exitting...")
  115.     )
  116. )
  117. ;
  118. ; ==================== deutsch ====================
  119. ;
  120. (if (= #installer_locale 1)
  121.     (set
  122.         ;=== general ===
  123.         ;
  124.         #welcome_text        (cat "Dieses Script installiert\n" @app-name "\nauf Ihrem System.")
  125.         #welcome_update      (cat "Dieses Script erneuert eine vorhandene Installation von\n" @app-name)
  126.         #welcome_remove      (cat "Dieses Script entfernt eine vorhandene Installation von\n" @app-name)
  127.         #error_instvers_msg  (cat "Sie benutzen den Installer in der Version %ld.%ld.\n"
  128.                                   "Die Installations wird wahrscheinlich nicht funktionieren.\n"
  129.                                   "Installation dennoch versuchen ?")
  130.         #error_instvers_help (cat "Die neueste Version ist zu finden unter http://www.amiga.de\nVersion 42.9+ wird benötigt.")
  131.         #action_prompt       (cat "Was wollen Sie ausführen ?")
  132.         #action_help         (cat "Wählen Sie eine Aktion.")
  133.         #action_install      (cat "Installieren")
  134.         #action_update       (cat "Erneuern")
  135.         #action_remove       (cat "Entfernen")
  136.         #cpu_too_low         (cat "Sie haben einen " (database "cpu") " Prozessor installiert, aber um " @app-name
  137.                                   " zu benutzen, benötigen Sie mindestens einen 68020 Prozessor.\nDie Installation "
  138.                                   "wird nun abgebrochen...")      
  139.         ;=== program files ===
  140.         ;           
  141.         #askdest_prompt    (cat "Zielverzeichnis für " @app-name " wählen. Es wird ein neues Verzeichnis erstellt, falls nötig.")
  142.         #askdest_help      (cat "Wählen Sie das Zielverzeichnis, in das " @app-name "installiert werden "
  143.                                 "soll. Es wird ein neues Verzeichnis erstellt.")
  144.         #files2copy_prompt (cat "Wählen Sie das zu installierende Hauptprogramm.")
  145.         #files2copy_help   (cat "Wählen Sie das zu installierende Hauptprogramm, das dem Prozessor Ihres System entspricht.")
  146.         #copycopy_prompt   (cat "Die %s Version von " @app-name " wird installiert.")
  147.         #copycopy_help     (cat #copycopy_prompt)
  148.         ;=== catalogs ===
  149.         ;
  150.         #catalog_f2c_prompt (cat "Wählen Sie den zu installierenden Sprach-Katalog.")
  151.         #catalog_f2c_help   (cat "Wählen Sie die Sprache, die das Hauptprogramm benutzen soll.")
  152.         #getcat_prompt      (cat "Zielverzeichnis für Katalog(e) wählen. Ein Verzeichnis wird erstellt, falls nötig.")
  153.         #getcat_help        (cat "Normalerweise sollte dasselbe Verzeichnis gewählt werden, "
  154.                                  "in welches das Hauptprogramm installiert wurde. Ein Verzeichnis "
  155.                                  "wird erstellt, falls nötig. LOCALE: wäre eine andere Möglichkeit.")
  156.         #copycat_prompt     (cat "Installiere %s Katalog...")
  157.         #copycat_help       (cat "Die %s Katalog-Dateien werden installiert.")
  158.         ;=== guide ===
  159.         ;
  160.         #guide_f2c_prompt (cat "Wählen Sie die zu installierende Dokumentation.")
  161.         #guide_f2c_help   (cat "Wählen Sie die Sprache der Dokumentation, die installiert werden soll.")
  162.         #getdoc_prompt    (cat "wählen Sie das Zielverzeichnis für die Dokumentation. Ein neues Verzeichnis wird erstellt, falls nötig.")
  163.         #getdoc_help      (cat "Normalerweise sollte dasselbe Verzeichnis gewählt werden, "
  164.                                " in welches das Hauptprogramm installiert wurde. Ein Verzeichnis "
  165.                                "wird erstellt, falls nötig.")
  166.         #copydoc_prompt   (cat "Installiere Dokumentation...")
  167.         #copydoc_help     (cat "Die %s Dokumentation wird installiert.")
  168.         #copydoc_misc_pmt (cat "Installiere zusätzliche Dokumentationen...")
  169.         #copydoc_misc_hlp (cat "Einige Texte mit zusätzliche Informationen werden installiert.")
  170.         ;=== arexx ===
  171.         ;
  172.         #rexx_f2c_prompt  (cat "ARexx-Beispieldateien installieren ?")
  173.         #rexx_f2c_help    (cat "Wählen Sie, ob die ARexx-Beispieldateien installiert werden sollen oder nicht.")
  174.         #rexx_dest_prompt (cat "Wählen Sie das Zielverzeichnis für die ARexx-Beispieldateien. Ein neues Verzeichnis "
  175.                                "wird erstellt, falls nötig.")
  176.         #rexx_dest_help   (cat "Wählen Sie das Verzeichnis, in welches die ARexx-Beispieldateien installiert "
  177.                                "werden sollen. Es wird ein neues Verzeichnis erstellt, falls nötig.")
  178.         #rexx_copy_prompt (cat "Installiere ARexx-Beispieldateien...")
  179.         #rexx_copy_help   (cat "Die ARexx-Beispieldateien werden kopiert.") 
  180.         ;=== wbstartup ===
  181.         ;                           
  182.         #cpy_wbstartup_prompt (cat @app-name " beim booten automatisch starten ?")
  183.         #cpy_wbstartup_help   (cat "Ein Piktogramm wird in das Verzeichnis SYS:WBStartup/ kopiert. "
  184.                                    "Jedesmal, wenn der Rechner bootet, wird " @app-name " automatisch gestartet. "
  185.                                    "Wählen Sie das zu startende Hauptprogramm.")
  186.         #cpy_wbstart_none     (cat "Nein")       
  187.         #wbstart_prompt       (cat "Die %s Version des Hauptprogramms wird beim booten gestartet.")
  188.         #wbstart_help         (cat "Die ausgewählte Version des Hauptprogramm von " @app-name " wird gestartet, "
  189.                                    "wenn der Rechner bootet.")          
  190.         ;=== tooltypes ===
  191.         ;
  192.         #ttype_prefs_prompt (cat "Da %s ein Commodity ist, müssen noch einige Einstellungen vorgenommen werden.\n"
  193.                                  "Geben Sie die Tastenkombination ein, mit der das Voreinstellungsfenster geöfnet werden soll, "
  194.                                  "z.B.\n'lshift lalt v' (= linke Shift-Taste + linke Alt-Taste + v):"
  195.                             )
  196.         #ttype_prefs_help   (cat "Geben Sie ein Tastenkombination ein, jedoch ohne \'.")
  197.         #ttype_load_prompt  (cat "Geben Sie die Tasenkonbination ein, die eine Dateiabfrage öffnet:")
  198.         #ttype_load_help    (cat "Wie vorherige. " #ttype_prefs_help)
  199.         #ttype_popup_prompt (cat "Soll das Voreinstellungsfenster automatisch nach dem Programmstart geöffnet werden ?")
  200.         #ttype_popup_help   (cat "Sie können dies später ändern über das ToolType CX_POPUP=<YES|NO>.")
  201.         #ttype_set_prompt   (cat "Die geforderten Änderung werden am %s Piktogramm vorgenommen.")
  202.         #ttype_set_help     (cat "Alle Anpassungen können später wieder von Hand geändert werden.")
  203.         ;=== update drawer ===
  204.         ;
  205.         #update_dest_prompt (cat "Wo befindet sich die Hauptprogramme der alten Installation von\n" @app-name " ?")
  206.         #update_dest_help   (cat "Wählen Sie das Verzeichnis, in welches die Hauptprogramme (oder das "
  207.                                  "Hauptprogramm) von " @app-name " installiert worden war(en).")
  208.         #update_f2c_prompt  (cat "Zu erneuernde(s) Hauptprogramm(e) wählen:")
  209.         #update_f2c_help    (cat "Wählen Sie das/die zu erneuernde(s) Hauptprogramm(e).")
  210.         #update_cat_prompt  (cat "Wählen Sie das Verzeichnis, in dem die Kataloge installiert sind.")
  211.         #update_cat_help    (cat "Dies sollte das Hauptprogramm-Verzeichnis sein oder LOCALE:")
  212.         #update_no_exe      (cat "Kann keine zu erneuernden Dateien finden. Breche ab...")
  213.         ;=== remove drawer ===
  214.         ;
  215.         #remove_safe_prompt (cat "Wollen Sie wirklich Ihre Installation von\n" @app-name "\nentfernen ?")
  216.         #remove_safe_help   (cat "Dies ist die letzte Chance abzubrechen !!!")
  217.         #remove_del_prompt  (cat "Entferne alte\n" @app-name "-Installation.")
  218.         #remove_del_help    (cat "Sie werden keine zweite Chance zum Abbruch bekommen !!!")
  219.         #remove_no_exe      (cat "Konnte kein(e) " @app-name " Hauptprogramm(e) im gewählten Verzeichnis "
  220.                                  "finden. Breche ab...")
  221.     )
  222. )
  223. ;
  224. ; ==================== sverige ====================
  225. ;
  226. (if (= #installer_locale 2)
  227.     (set
  228.         ;=== general ===
  229.         ;
  230.         #welcome_text        (cat "This script lets you install\n" @app-name "\non your system.")
  231.         #welcome_update      (cat "This script will update an existing\n" @app-name "\ninstallation.")
  232.         #welcome_remove      (cat "This script will remove an existing\n" @app-name "\ninstallation.")
  233.         #error_instvers_msg  (cat "You are using the installer version %ld.%ld.\n"
  234.                                   "This script will probably not work.\n"
  235.                                   "Try installing anyway ?")
  236.         #error_instvers_help (cat "Get the most resent version from http://www.amiga.de\nVersion 42.9+ is required.")
  237.         #action_prompt       (cat "What do you want to do ?")
  238.         #action_help         (cat "Select an action to perform.")
  239.         #action_install      (cat "Install")
  240.         #action_update       (cat "Update")
  241.         #action_remove       (cat "Remove")
  242.         #cpu_too_low         (cat "You have installed a " (database "cpu") " processor, but a 68020 processor "
  243.                                   "is minimal required in order to use " @app-name ".\nI'm quitting now...")
  244.         ;=== program files ===
  245.         ;
  246.         #askdest_prompt    (cat "Select destination for " @app-name ". A drawer will be created, if necessary.")
  247.         #askdest_help      (cat "Select the destination drawer for " @app-name ". A new drawer will be generated.")
  248.         #files2copy_prompt (cat "Select main program to install.")
  249.         #files2copy_help   (cat "Select the program file to install according to the processor your system has.")
  250.         #copycopy_prompt   (cat "The %s version of " @app-name " will be copied.")
  251.         #copycopy_help     (cat #copycopy_prompt)
  252.         ;=== catalogs ===
  253.         ;
  254.         #catalog_f2c_prompt (cat "Select language catalog to copy.")
  255.         #catalog_f2c_help   (cat "Select the language(s) to install.")
  256.         #getcat_prompt      (cat "Select target drawer for catalog(s). A drawer will be created, if necessary.")
  257.         #getcat_help        (cat "Normally, select the drawer the main program was installed to. "
  258.                                  "A new drawer will be generated, if necessary. "
  259.                                  "LOCALE: would be another option.")
  260.         #copycat_prompt     (cat "Copying %s catalog...")
  261.         #copycat_help       (cat "The %s catalog files will be copied.")
  262.         ;=== guide ===
  263.         ;
  264.         #guide_f2c_prompt (cat "Select documentation to install.")
  265.         #guide_f2c_help   (cat "Select documentation language you like to install.")
  266.         #getdoc_prompt    (cat "Select destination for documentation. A drawer will be created, if necessary.")
  267.         #getdoc_help      (cat "Normally, select the drawer the main program was installed to. "
  268.                                "A new drawer will be generated, if necessary.")
  269.         #copydoc_prompt   (cat "Copying documentation...")
  270.         #copydoc_help     (cat "The %s documentation will be copied.")
  271.         #copydoc_misc_pmt (cat "Copying miscellaneous documentation...")
  272.         #copydoc_misc_hlp (cat "Some additional texts will be copied.")
  273.         ;=== arexx ===
  274.         ;
  275.         #rexx_f2c_prompt  (cat "Install arexx examples ?")
  276.         #rexx_f2c_help    (cat "Select wether to install the example arexx files or not.")
  277.         #rexx_dest_prompt (cat "Select arexx example drawer. A new drawer will be created, if necessary.")
  278.         #rexx_dest_help   (cat "Select a drawer into which the example arexx files will be installed. "
  279.                                "A new drawer will be generated, if necessary.")
  280.         #rexx_copy_prompt (cat "Copying arexx examples...")
  281.         #rexx_copy_help   (cat "The arexx example files will be copied.")
  282.         ;=== wbstartup ===
  283.         ;
  284.         #cpy_wbstartup_prompt (cat "Start " @app-name " automatically every time you boot ?")
  285.         #cpy_wbstartup_help   (cat "An icon will be copied to SYS:WBStartup/ drawer. Every time you boot "
  286.                                    @app-name " will be started automatically. Select the program version "
  287.                                    "to be started.")
  288.         #cpy_wbstart_none     (cat "No")
  289.         #wbstart_prompt       (cat "The %s client will be started on boot time.")
  290.         #wbstart_help         (cat "The selected version of " @app-name " will be started during booting.")
  291.         ;=== tooltypes ===
  292.         ;
  293.         #ttype_prefs_prompt (cat "Since %s is a commodity some setup is required.\n"
  294.                                  "Type the keys which will bring up the preferences window, "
  295.                                  "for example\n'lshift lalt v' (= left shift + left alt + v):"
  296.                             )
  297.         #ttype_prefs_help   (cat "Type in a combination of keys, but without then \'.")
  298.         #ttype_load_prompt  (cat "Type the keys which will bring up a file load requester:")
  299.         #ttype_load_help    (cat "Same as previous. " #ttype_prefs_help)
  300.         #ttype_popup_prompt (cat "Should the preferences window open automatically after program start ?")
  301.         #ttype_popup_help   (cat "You can change this later via the tooltype CX_POPUP=<YES|NO>.")
  302.         #ttype_set_prompt   (cat "The requested changes to the %s program icon will be made.")
  303.         #ttype_set_help     (cat "All changes can be manually altered later.")
  304.         ;=== update drawer ===
  305.         ;
  306.         #update_dest_prompt (cat "Locate " @app-name "'s executable(s):")
  307.         #update_dest_help   (cat "Select the drawer where " @app-name "'s executable(s) resides in.")
  308.         #update_f2c_prompt  (cat "Select executables to update:")
  309.         #update_f2c_help    (cat "Select that executable(s) which should be updated.")
  310.         #update_cat_prompt  (cat "Select drawer where old catalogs were installed:")
  311.         #update_cat_help    (cat "This should be either the drawer where the executables reside in "
  312.                                  "or LOCALE:")
  313.         #update_no_exe      (cat "Couldn't find files to update. Exitting...")
  314.         ;=== remove drawer ===
  315.         ;
  316.         #remove_safe_prompt (cat "Do you really want to delete your\n" @app-name "\ninstallation ?")
  317.         #remove_safe_help   (cat "This is the last chance to cancel !!!")
  318.         #remove_del_prompt  (cat "Deleting old\n" @app-name "\ninstallation.")
  319.         #remove_del_help    (cat "You will get no second chance to quit !!!")
  320.         #remove_no_exe      (cat "Didn't find " @app-name " executable(s) in selected drawer. Exitting...")
  321.     )
  322. )
  323. ;======================================
  324. ;=== Get install destination drawer ===
  325. ;======================================
  326. (procedure P_GetDestination
  327.     (debug "Ask destination drawer:")
  328.     (P_GetDestBaseDrawer)
  329.     (set @default-dest (tackon @default-dest @app-name))   
  330.     (debug "Destination drawer is" @default-dest ".\n")      
  331. )
  332.  
  333. (procedure P_GetDestBaseDrawer      
  334.     (set @default-dest 
  335.         (askdir
  336.             (prompt  #askdest_prompt)
  337.             (help    #askdest_help "\n\n" @askdir-help)
  338.             (default "RAM:")
  339.             (newpath)
  340.         ) 
  341.     )                                                   
  342. )
  343.  
  344. ;===============================
  345. ;=== Copy main program files ===
  346. ;===============================
  347. (procedure P_CopyMainFiles
  348.     ;;;
  349.     ; Get destination drawer
  350.     ;;;
  351.     (P_GetDestination)
  352.     ;;;
  353.     ; Select main program files to install
  354.     ;;;
  355.     (set #program_files2copy
  356.         (askoptions
  357.             (prompt  #files2copy_prompt)
  358.             (help    #files2copy_help "\n\n" @askoptions-help)
  359.             (choices (cat @app-name "68k")
  360.                      (cat @app-name "68k FPU")
  361.                      (cat @app-name "PPC")      
  362.             )
  363.             (default 0)
  364.         )
  365.     )                                            
  366.     (if (= #program_files2copy 0) (exit (quiet)))
  367.     ;;;
  368.     ; Generate destination drawer
  369.     ;;;
  370.     (makedir @default-dest
  371.         (infos)
  372.     )
  373.     (debug "Drawer" @default-dest "generated.")
  374.     ;;;
  375.     ; Copy requested files
  376.     ;;;
  377.     (if (IN #program_files2copy 0) (P_CopyOneExecutable "68k")) 
  378.     (if (IN #program_files2copy 1) (P_CopyOneExecutable "68k_fpu"))
  379.     (if (IN #program_files2copy 2) (P_CopyOneExecutable "PPC"))
  380.     (debug "Main files copied.\n")
  381. )
  382.  
  383. (procedure P_CopyOneExecutable #exe_name
  384.     (debug ("Copying %s files..." #exe_name))
  385.     (copyfiles
  386.         (prompt (#copycopy_prompt #exe_name))
  387.         (help   (#copycopy_help #exe_name) "\n\n" @copyfiles-help)
  388.         (source "/")
  389.         (dest   @default-dest)
  390.         (pattern (cat "#?" #exe_name "#?"))
  391.         (infos)
  392.         (confirm)
  393.     )
  394. )
  395.  
  396. ;=====================
  397. ;=== Copy catalogs ===
  398. ;=====================         
  399. (procedure P_CopyCatalogs 
  400.     (debug "Ask catalogs to copy:")
  401.     ;;;
  402.     ; Select catalogs to copy
  403.     ;;;
  404.     (if (= @user-level 2)
  405.         (
  406.             (debug "Ask catalog language.")
  407.             (set #catalog_files2copy
  408.                 (askoptions
  409.                     (prompt  #catalog_f2c_prompt)
  410.                     (help    #catalog_f2c_help "\n\n" @askoptions-help)
  411.                     (choices "english (built in)"
  412.                              "deutsch"
  413.                              ;;;"sverige"
  414.                     )
  415.                     (default (shiftleft 1 #installer_locale))
  416.                 )
  417.             )
  418.         )
  419.         ;else
  420.         (
  421.             (debug "Copy install script language catalog.")           
  422.             (set #catalog_files2copy (shiftleft 1 #installer_locale))
  423.         )
  424.     )
  425.     ;;;
  426.     ; Get catalog drawer
  427.     ;;;
  428.     (if (= @user-level 2)
  429.         (
  430.             (debug "Ask target drawer for catalogs.")
  431.             (set #copycat_target
  432.                 (askdir
  433.                     (prompt  #getcat_prompt)
  434.                     (help    #getcat_help "\n\n" @askdir-help)
  435.                     (default @default-dest)
  436.                     (newpath)
  437.                 )
  438.             )
  439.         )
  440.         ;else
  441.         (
  442.             (debug "Set target for catalogs to default destination.")
  443.             (set #copycat_target @default-dest)
  444.         )
  445.     )                                                
  446.     ;;;
  447.     ; Create drawer
  448.     ;;;
  449.     (set #copycat_target
  450.         (tackon #copycat_target "Catalogs")
  451.     )
  452.     (makedir #copycat_target)
  453.     (debug "Selected drawer for catalogs is" #copycat_target ".\n")
  454.     ;;;
  455.     ; Copy catalogs
  456.     ;;;                                                              
  457.     (if (IN #catalog_files2copy 0) (P_CopyOneCatalog "english")) 
  458.     (if (IN #catalog_files2copy 1) (P_CopyOneCatalog "deutsch")) 
  459.     (if (IN #catalog_files2copy 2) (P_CopyOneCatalog "sverige"))
  460.     (debug "Catalogs copied.\n")
  461. )
  462.  
  463. (procedure P_CopyOneCatalog #language_name  
  464.     (debug ("Copying %s catalog to %s." #language_name #copycat_target))
  465.     (makedir (tackon #copycat_target #language_name))                    
  466.     (copyfiles
  467.         (prompt (#copycat_prompt #language_name))
  468.         (help   (#copycat_help #language_name) "\n\n" @copyfiles-help)
  469.         (source (cat "/Catalogs/" #language_name "/"))
  470.         (dest   (tackon #copycat_target (cat #language_name "/")))
  471.         (all)
  472.         (confirm)
  473.     )
  474. )
  475.  
  476. ;=================
  477. ;=== Copy docs ===
  478. ;=================
  479. (procedure P_CopyDocs
  480.     (debug "Ask guide to copy:")
  481.     ;;;
  482.     ; Select docs to copy
  483.     ;;;
  484.     (if (= @user-level 2)
  485.         (
  486.             (debug "Ask documentation language.")
  487.             (set #catalog_files2copy
  488.                 (askchoice
  489.                     (prompt  #guide_f2c_prompt)
  490.                     (help    #guide_f2c_help "\n\n" @askchoice-help)
  491.                     (choices "english"
  492.                              "deutsch"
  493.                              ;;;"sverige"
  494.                     )
  495.                     (default #installer_locale)
  496.                 )
  497.             )
  498.         )
  499.         ;else
  500.         (
  501.             (debug "Copy install script language documentation.")
  502.             (set #catalog_files2copy #installer_locale)
  503.         )
  504.     )
  505.     ;;;
  506.     ; Get doc drawer    
  507.     ;;;
  508.     (if (= @user-level 2)
  509.         (
  510.             (debug "Ask target drawer for docs.")
  511.             (set #copydoc_target
  512.                 (askdir
  513.                     (prompt  #getdoc_prompt)
  514.                     (help    #getdoc_help "\n\n" @askdir-help)
  515.                     (default @default-dest)
  516.                     (newpath)
  517.                 )
  518.             )
  519.         )
  520.         ;else
  521.         (
  522.             (debug "Set target for docs to program drawer.")
  523.             (set #copydoc_target @default-dest)
  524.         )
  525.     )                                             
  526.     ;;;
  527.     ; Create drawer
  528.     ;;;
  529.     (set #copydoc_target
  530.         (tackon #copydoc_target "Guide")
  531.     )
  532.     (makedir #copydoc_target)    
  533.     ;;;
  534.     ; Copy docs
  535.     ;;;
  536.     (if (= #catalog_files2copy 0) (P_CopyOneGuide "English.guide"))  
  537.     (if (= #catalog_files2copy 1) (P_CopyOneGuide "Deutsch.guide"))  
  538.     (if (= #catalog_files2copy 2) (P_CopyOneGuide "Sverige.guide"))
  539.     ;;;
  540.     ; Copy miscellaneous texts
  541.     ;;;
  542.     (copyfiles
  543.         (prompt  #copydoc_misc_pmt)
  544.         (help    #copydoc_misc_hlp "\n\n" @copyfiles-help)
  545.         (source  "/Guide/")
  546.         (dest    #copydoc_target)
  547.         (pattern "#?.txt")
  548.     )
  549.     (debug "Guides copied.\n")
  550. )
  551.  
  552. (procedure P_CopyOneGuide #guide_name
  553.     (debug ("Copying %s." #guide_name))
  554.     (copyfiles
  555.         (prompt  (#copydoc_prompt #guide_name))
  556.         (help    (#copydoc_help #guide_name) "\n\n" @copyfiles-help)
  557.         (source  (cat "/Guide/" #guide_name))
  558.         (dest    #copydoc_target) 
  559.         (newname (cat @app-name ".guide"))
  560.         (confirm)
  561.     )   
  562.     (copyfiles
  563.         (prompt  (#copydoc_prompt #guide_name))
  564.         (help    (#copydoc_help #guide_name) "\n\n" @copyfiles-help)
  565.         (source  (cat "/Guide/" #guide_name ".info"))
  566.         (dest    #copydoc_target)
  567.         (newname (cat @app-name ".guide.info"))  
  568.     )
  569. )
  570.  
  571. ;==========================
  572. ;=== Copy rexx examples ===
  573. ;==========================
  574. (procedure P_CopyRexxExamples
  575.     (debug "Ask wether arexx examples to copy.")
  576.     ;;;
  577.     ; Copy arexx examples ?   
  578.     ;;;
  579.     (if (= @user-level 2)
  580.         (
  581.             (debug "Ask wether to install arexx examples.")
  582.             (set #copy_rexx
  583.                 (askbool
  584.                     (prompt  #rexx_f2c_prompt)
  585.                     (help    #rexx_f2c_help "\n\n" @askbool-help) 
  586.                     (default 1)
  587.                 )
  588.             )
  589.         )
  590.         ;else
  591.         (
  592.             (debug "Install arexx examples by default.")
  593.             (set #copy_rexx 1)
  594.         )
  595.     )
  596.     ;;;
  597.     ; Copy examples requested
  598.     ;;;
  599.     (if (= #copy_rexx 1)
  600.         (
  601.             (debug "Install rexx examples.")
  602.             ;;;
  603.             ; Get arexx drawer
  604.             ;;;
  605.             (if (= @user-level 2)
  606.                 (
  607.                     (debug "Ask target drawer for arexx")
  608.                     (set #copyrexx_target
  609.                         (askdir
  610.                             (prompt  #rexx_dest_prompt)
  611.                             (help    #rexx_dest_help "\n\n" @askdir-help)
  612.                             (default @default-dest)
  613.                             (newpath)
  614.                         )
  615.                     )
  616.                 )
  617.                 ;else
  618.                 (
  619.                     (debug "Set target for rexx to program drawer")
  620.                     (set #copyrexx_target @default-dest)
  621.                 )
  622.             )                                                
  623.             ;;;
  624.             ; Create drawer
  625.             ;;;
  626.             (set #copyrexx_target
  627.                 (tackon #copyrexx_target "Rexx")
  628.             )
  629.             (makedir #copyrexx_target)  
  630.             ;;;
  631.             ; Copy files
  632.             ;;;
  633.             (debug "Copying arexx examples.")
  634.             (copyfiles
  635.                 (prompt  #rexx_copy_prompt)
  636.                 (help    #rexx_copy_help "\n\n" @copyfiles-help)
  637.                 (source  "/Rexx/")
  638.                 (dest    #copyrexx_target)
  639.                 (all)              
  640.                 (confirm)
  641.             )                                               
  642.             (debug "ARexx examples copied.\n")
  643.         )
  644.     )
  645. )                                                      
  646.  
  647. ;=====================
  648. ;=== Set tooltypes ===
  649. ;=====================
  650. (procedure P_InitToolTypes
  651.     (debug "About to set tooltypes.")
  652.     ;;;
  653.     ; Pop up preferences keys
  654.     ;;;
  655.     (set #ttype_prefs_key
  656.         (askstring
  657.             (prompt (#ttype_prefs_prompt @app-name))
  658.             (help   #ttype_prefs_help "\n\n" @askstring-help)
  659.         )
  660.     )
  661.     (debug ("Prefs popup key is %s." #ttype_prefs_key))
  662.     ;;;
  663.     ; Pop up load key
  664.     ;;;
  665.     (set #ttype_load_key
  666.         (askstring
  667.             (prompt #ttype_load_prompt)
  668.             (help   #ttype_load_help "\n\n" @askstring-help)
  669.         )
  670.     )
  671.     (debug ("Prefs popup key is %s." #ttype_load_key))
  672.     ;;;
  673.     ; Pop up preferences after start
  674.     ;;;
  675.     (set #ttype_popup
  676.         (askbool
  677.             (prompt #ttype_popup_prompt)
  678.             (help   #ttype_popup_help "\n\n" @askbool-help)
  679.             (default 0)
  680.         )
  681.     )
  682.     (if (= #ttype_popup 0)
  683.         (
  684.             (set #ttype_popup "NO")
  685.         )
  686.         ;else
  687.         (
  688.             (set #ttype_popup "YES")
  689.         )
  690.     )
  691.     (debug ("Popup preferences after program start is set to %s." #ttype_popup))
  692.     ;;;
  693.     ; Adjust tooltypes
  694.     ;;;
  695.     (if (IN #program_files2copy 0) (P_SetToolTypes "68k"))
  696.     (if (IN #program_files2copy 1) (P_SetToolTypes "68k_fpu"))
  697.     (if (IN #program_files2copy 2) (P_SetToolTypes "PPC"))
  698.     ;;;
  699.     ; Copy icon to wbstartup
  700.     ;;;
  701.     (if (= #copy_wbstartup 1) (P_CopyWBStartup "68k"))
  702.     (if (= #copy_wbstartup 2) (P_CopyWBStartup "68k_fpu"))
  703.     (if (= #copy_wbstartup 3) (P_CopyWBStartup "PPC"))
  704. )
  705.  
  706. (procedure P_CopyWBStartup #main_type
  707.     (debug ("Copy %s icon to SYS:WBStartup/." #main_type))
  708.     (set #wbstartup_target "SYS:WBStartup/")
  709.     (copyfiles
  710.         (prompt  (#wbstart_prompt #main_type))
  711.         (help    #wbstart_help "\n\n" @copyfiles-help)
  712.         (source  "WBStartup_icon")
  713.         (dest    #wbstartup_target)
  714.         (newname (cat @app-name #main_type ".info"))
  715.         (confirm)
  716.     )                                          
  717.     (tooltype    
  718.         (dest (cat #wbstartup_target @app-name #main_type))
  719.         (setdefaulttool (cat (tackon @default-dest @app-name) #main_type))
  720.         (settooltype "LOADKEY"   #ttype_load_key)
  721.         (settooltype "CX_POPKEY" #ttype_prefs_key)
  722.         (settooltype "CX_POPUP"  #ttype_popup)
  723.         (settooltype "DONOTWAIT" "")
  724.         (setstack 16384)
  725.         (noposition)
  726.     )
  727. )                       
  728.  
  729. (procedure P_SetToolTypes #name_expand 
  730.     (debug ("Setting %s icon information." #name_expand))
  731.     (tooltype
  732.         (prompt (#ttype_set_prompt #name_expand))
  733.         (help #ttype_set_help)
  734.         (dest (cat (tackon @default-dest @app-name) #name_expand))
  735.         (settooltype "LOADKEY"   #ttype_load_key)
  736.         (settooltype "CX_POPKEY" #ttype_prefs_key)
  737.         (settooltype "CX_POPUP"  #ttype_popup)
  738.         (settooltype "DONOTWAIT" "")
  739.         (setstack 16384)
  740.         (noposition)
  741.         (confirm)
  742.     )
  743. )
  744.  
  745. ;=====================
  746. ;=== Install stuff ===
  747. ;=====================
  748. (procedure P_Install
  749.     (debug "Perform installation")
  750.     (welcome #welcome_text)
  751.  
  752.     (P_CopyMainFiles)
  753.     (complete 25)
  754.  
  755.     (P_CopyCatalogs)
  756.     (complete 50)
  757.  
  758.     (P_CopyDocs)
  759.     (complete 75)
  760.  
  761.     (P_CopyRexxExamples)
  762.     (complete 99)
  763.     ;
  764.     ;=== Copy icon to wbstartup
  765.     ;
  766.     (set #cpy_wbstart_68k     "")
  767.     (set #cpy_wbstart_68k_fpu "")
  768.     (set #cpy_wbstart_ppc     "")
  769.     (if (IN #program_files2copy 0) (set #cpy_wbstart_68k     (cat @app-name "68k")))
  770.     (if (IN #program_files2copy 1) (set #cpy_wbstart_68k_fpu (cat @app-name "68k FPU")))
  771.     (if (IN #program_files2copy 2) (set #cpy_wbstart_ppc     (cat @app-name "PPC")))
  772.     (set #copy_wbstartup
  773.         (askchoice
  774.             (prompt  #cpy_wbstartup_prompt)
  775.             (help    #cpy_wbstartup_help "\n\n" @askchoice-help)
  776.             (choices #cpy_wbstart_none
  777.                      #cpy_wbstart_68k
  778.                      #cpy_wbstart_68k_fpu
  779.                      #cpy_wbstart_ppc
  780.             )
  781.             (default 0)
  782.         )
  783.     )                    
  784.     (debug ("Copy to SYS:WBStartup/ is %ld." #copy_wbstartup))
  785.  
  786.     (P_InitToolTypes)
  787.     (complete 100)
  788. )
  789.  
  790. ;=======================================
  791. ;=== Update an existing installation ===
  792. ;=======================================
  793. (procedure P_Update
  794.     (debug "Perform update")
  795.     (welcome #welcome_update)
  796.     ;=== Get destination drawer ===
  797.     ;
  798.     (set #askdest_prompt #update_dest_prompt
  799.          #askdest_help   #update_dest_help  
  800.     )
  801.     (P_GetDestBaseDrawer)
  802.     (debug ("Old installation in %s." @default-dest))
  803.     ;=== Get files to update ===
  804.     ;
  805.     (set #update_files 0)
  806.     (P_FilesToUpdate "68k"     1)
  807.     (P_FilesToUpdate "68k_fpu" 2)
  808.     (P_FilesToUpdate "PPC"     4)
  809.     (debug ("Update executable bitmask is %ld.\n" #update_files))
  810.     (if (= #update_files 0)
  811.         (
  812.             (message #update_no_exe)
  813.             (exit (quiet))
  814.         )                                                            
  815.     )
  816.     ;=== Update main ===
  817.     ;                     
  818.     (if (IN #update_files 0)
  819.         (set #upd_68k (cat @app-name "68k"))
  820.         ;else
  821.         (set #upd_68k "")
  822.     )
  823.     (if (IN #update_files 1)
  824.         (set #upd_68k_fpu (cat @app-name "68k FPU"))
  825.         ;else
  826.         (set #upd_68k_fpu "")
  827.     )
  828.     (if (IN #update_files 2)
  829.         (set #upd_PPC (cat @app-name "PPC"))
  830.         ;else
  831.         (set #upd_PPC "")
  832.     )
  833.     (if (= @user-level 2)
  834.         (set #update_files
  835.             (askoptions
  836.                 (prompt  #update_f2c_prompt)
  837.                 (help    #update_f2c_help "\n\n" @askoptions-help)
  838.                 (choices #upd_68k
  839.                          #upd_68k_fpu
  840.                          #upd_PPC
  841.                 )
  842.                 (default 0)
  843.             )
  844.         )
  845.     )
  846.     (if (IN #update_files 0) (P_CopyOneExecutable "68k"))
  847.     (if (IN #update_files 1) (P_CopyOneExecutable "68k_fpu"))
  848.     (if (IN #update_files 2) (P_CopyOneExecutable "PPC"))
  849.     (debug "Main files updated.")
  850.     ;=== Update catalog(s) ===
  851.     ;                                   
  852.     (if (OR (= @user-level 2) (NOT (exists (tackon @default-dest "Catalogs"))))
  853.         (
  854.             (debug "Ask old catalogs drawer.")
  855.             (set #copycat_target
  856.                 (askdir
  857.                     (prompt  #update_cat_prompt)
  858.                     (help    #update_cat_help "\n\n" @askdir-help)
  859.                     (default @default-dest)
  860.                     (newpath)
  861.                 )
  862.             )
  863.         )      
  864.         ;else
  865.         (
  866.             (debug "Set target for catalogs to default destination.")
  867.             (set #copycat_target @default-dest)
  868.         )
  869.     )
  870.     (set #copycat_target
  871.         (tackon @default-dest "Catalogs")
  872.     )
  873.     (if (exists #copycat_target)
  874.         (foreach #copycat_target "#?"
  875.             (P_CopyOneCatalog @each-name)
  876.         )
  877.     )
  878.     (debug "Catalogs updated.")
  879.     ;=== Update doc ===
  880.     ;
  881.     (P_CopyDocs)
  882.     ;=== Update rexx ===
  883.     ;
  884.     (P_CopyRexxExamples)
  885.     (debug "Update complete.\n")
  886. )
  887.  
  888. (procedure P_FilesToUpdate #file_expand #bit_mask
  889.     (set #update_filename (cat (tackon @default-dest @app-name) #file_expand))
  890.     (debug ("Updating file %s ?" #update_filename))
  891.     (if (exists #update_filename)
  892.         (                    
  893.             (set #update_files (BITOR #update_files #bit_mask))
  894.             (debug ("\tUpdating old %s file." #update_filename))
  895.         )
  896.         ;else
  897.         (
  898.             (debug "\tNo old installation found.")
  899.         ) 
  900.     )
  901. )
  902.  
  903. ;====================================
  904. ;=== Remove existing installation ===
  905. ;====================================
  906. (procedure P_Remove
  907.     (debug "Perform remove")    
  908.     (welcome #welcome_remove)
  909.     ;=== Get destination drawer ===
  910.     ;
  911.     (set #askdest_prompt #update_dest_prompt  
  912.          #askdest_help   #update_dest_help    
  913.     )
  914.     (P_GetDestBaseDrawer)
  915.     (debug ("Drawer to remove is %s." @default-dest)) 
  916.     ;=== Main executable(s) there ? ===
  917.     ;
  918.     (debug "Main executable(s) there ?")
  919.     (if (NOT (exists (cat (tackon @default-dest @app-name) "68k")))
  920.         (
  921.             (if (NOT (exists (cat (tackon @default-dest @app-name) "68k_fpu")))
  922.                 (
  923.                     (if (NOT (exists (cat (tackon @default-dest @app-name) "PPC")))
  924.                         (
  925.                             (message #remove_no_exe)
  926.                             (exit (quiet))
  927.                         )
  928.                     )
  929.                 )
  930.             )
  931.         )
  932.     )    
  933.     ;=== Remove drawer ===
  934.     ;
  935.     (set #really_delete
  936.         (askbool
  937.             (prompt  #remove_safe_prompt)
  938.             (help    #remove_safe_help "\n\n" @askbool-help)
  939.             (default 0)
  940.         )
  941.     )
  942.     (if (= #really_delete 1)
  943.         (
  944.             (debug ("Deleting drawer %s." @default-dest))
  945.             (set @default-dest (tackon @default-dest "/"))
  946.             (set @default-dest (substr @default-dest 0 (- (strlen @default-dest) 2)))
  947.             (delete @default-dest
  948.                 (prompt #remove_del_prompt)
  949.                 (help   #remove_del_help)
  950.                 (all)
  951.                 (optional askuser)
  952.                 (confirm)
  953.             )                                             
  954.             (delete (cat @default-dest ".info")
  955.                 (prompt #remove_del_prompt)
  956.                 (help   #remove_del_help) 
  957.                 (optional askuser)  
  958.             )          
  959.             (set @default-dest "RAM:")
  960.         )
  961.     )
  962. )
  963.  
  964. ;============
  965. ;=== Main ===
  966. ;============                        
  967. (complete 0)
  968.           
  969. ;=== Check 68k processor version ===
  970. ;
  971. (debug ("CPU is a %s." (database "cpu")))
  972. (if (patmatch "(68000|68010)" (database "cpu"))
  973.     (
  974.         (message #cpu_too_low)
  975.         (exit (quiet))
  976.     )
  977. )                                 
  978. ;=== Check installer version & exit eventually ===
  979. ;
  980. (set #install_ver (/ @installer-version 65536))
  981. (set #install_rev (- @installer-version (* #install_ver 65536))) 
  982. (debug ("Installer version %ld.%ld." #install_ver #install_rev))
  983. (if (< #install_ver 43)
  984.     (
  985.         (debug "Installer version too low.")           
  986.         (set #installer_ok
  987.             (askbool
  988.                 (prompt (#error_instvers_msg #install_ver #install_rev))
  989.                 (help   #error_instvers_help "\n\n" @askbool-help)
  990.                 (default 0)
  991.             )
  992.         )
  993.     )
  994.     ;else
  995.     (
  996.         (debug "Installer version is ok.")
  997.         (set #installer_ok 1)
  998.     )
  999. )
  1000. (if (NOT #installer_ok)
  1001.     (
  1002.         (debug "Aborting installation.")
  1003.         (exit (quiet))
  1004.     )
  1005. )
  1006. ;=== Select type of action ===
  1007. ;                       
  1008. (set #type_of_action
  1009.     (askchoice
  1010.         (prompt  #action_prompt)
  1011.         (help    #action_help "\n\n" @askchoice-help)
  1012.         (choices
  1013.             #action_install
  1014.             #action_update
  1015.             #action_remove
  1016.         )
  1017.     )
  1018. )                                                  
  1019. (if (= #type_of_action 0) (P_Install))
  1020. (if (= #type_of_action 1) (P_Update))
  1021. (if (= #type_of_action 2) (P_Remove))
  1022. (exit)
  1023.